#include<iostream>
using namespace std;
string operator+(string str1, string str2){
	int f[100000] = {0};
    int s[100000] = {0};
    int sum[100000] = {0};
    string sum_s;
    for (int i=0;i<str1.length();i++) {
        f[str1.length() - 1 - i] = str1[i] - '0';
    }
    for (int i=0;i<str2.length();i++) {
        s[str2.length() - 1 - i] = str2[i] - '0';
    }

    int max = str1.length() > str2.length() ? str1.length() : str2.length();

    int m=max;
    for (int i = 0; i < max; i++) {
        sum[i] = sum[i] + f[i] + s[i];
        if (sum[i] >= 10) {
            sum[i + 1] = sum[i] / 10;
            sum[i] = sum[i] % 10;
            if(i==max-1)
            	++m;
        }
    }
    
	max=m;
    while (max > 0 && sum[max - 1] == 0) {
        max--;
    }
    for (int i = max - 1; i >= 0; i--) {
//    	cout<<sum[i];
        sum_s+=('0'+sum[i]);
//        cout<<sum_s;
    }
    return sum_s;
}
string fibonacci(string a,string b,int n) {
    if (n == 1) return a;
    if (n == 2) return b;
    
    string c;
    for (int i = 3; i <= n; ++i) {
        c = a + b;
        a = b;
        b = c;
//        cout<<b;
    }
    return b;
}
int main(){
	string a,b;
	int c;
	cin>>a>>b>>c;
	cout<<fibonacci(a,b,c);
	//245625764327 2346863287674=2592489052001yes
	//1 1 2 3 5 8 13 21 34 55 89 144 
	
} 
